//
//  WXInputSelectTableViewCell.m
//  CarJX
//
//  Created by jxcl on 14-11-1.
//  Copyright (c) 2014年 KK. All rights reserved.
//

#import "WXInputSelectTableViewCell.h"


@implementation WXInputselectObject


-(UINib *)cellNib
{
    return [UINib nibWithNibName:@"WXInputSelectTableViewCell" bundle:nil];
}
@end



@implementation WXInputSelectTableViewCell
-(BOOL)shouldUpdateCellWithObject:(id)object
{
    WXInputselectObject *ptObject = object;
    self.title.text = ptObject.title;
    self.placeholder.placeholder = ptObject.placeholder;
    [self.button setTitle:ptObject.buttonTitle forState:UIControlStateNormal];
    self.cellObject = ptObject;
    return YES;
}


- (void)awakeFromNib
{
    self.button.layer.masksToBounds = YES;
    self.button.layer.cornerRadius = 10;
    [self.button addTarget:self action:@selector(didTouch) forControlEvents:UIControlEventTouchUpInside];
}
-(void) didTouch
{
    if (self.cellObject.target && self.cellObject.seletor && [self.cellObject.target respondsToSelector:self.cellObject.seletor]) {
        [self.cellObject.target performSelector:self.cellObject.seletor withObject:self.button];
        
    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
